<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>roman</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://sites.google.com/site/pyminesweeper/">Minesweeper</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;roman
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="roman-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module roman</h1><p class="nomargin-top"><span class="codelink"><a href="roman-pysrc.html">source&nbsp;code</a></span></p>
<p>Convert to and from Roman numerals</p>
  <p>This program is part of &quot;Dive Into Python&quot;, a free Python 
  book for experienced programmers.  Visit http://diveintopython.org/ for 
  the latest version.</p>

<hr />
<div class="fields">      <p><strong>Version:</strong>
        $Revision: 1.3 $
      </p>
      <p><strong>Date:</strong>
        $Date: 2004/05/05 21:57:20 $
      </p>
      <p><strong>Author:</strong>
        Steve Lamm, Mark Pilgrim (mark@diveintopython.org)
      </p>
      <p><strong>Copyright:</strong>
        Copyright (c) 2001 Steve Lamm, Copyright (c) 2001 Mark Pilgrim
      </p>
      <p><strong>License:</strong>
        Python
      </p>
</div><!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Classes"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="roman.RomanError-class.html" class="summary-name">RomanError</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="roman.OutOfRangeError-class.html" class="summary-name">OutOfRangeError</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="roman.NotIntegerError-class.html" class="summary-name">NotIntegerError</a>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="roman.InvalidRomanNumeralError-class.html" class="summary-name">InvalidRomanNumeralError</a>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="toRoman"></a><span class="summary-sig-name">toRoman</span>(<span class="summary-sig-arg">n</span>)</span><br />
      convert integer to Roman numeral</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="roman-pysrc.html#toRoman">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="fromRoman"></a><span class="summary-sig-name">fromRoman</span>(<span class="summary-sig-arg">s</span>)</span><br />
      convert Roman numeral to integer</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="roman-pysrc.html#fromRoman">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="toRomanDynamic"></a><span class="summary-sig-name">toRomanDynamic</span>(<span class="summary-sig-arg">n</span>)</span><br />
      convert integer to Roman numeral using dynamic programming</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="roman-pysrc.html#toRomanDynamic">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="fillLookupTables"></a><span class="summary-sig-name">fillLookupTables</span>()</span><br />
      compute all the possible roman numerals</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="roman-pysrc.html#fillLookupTables">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="MAX_ROMAN_NUMERAL"></a><span class="summary-name">MAX_ROMAN_NUMERAL</span> = <code title="4999">4999</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="roman-module.html#romanNumeralMap" class="summary-name">romanNumeralMap</a> = <code title="(('M', 1000),
 ('CM', 900),
 ('D', 500),
 ('CD', 400),
 ('C', 100),
 ('XC', 90),
 ('L', 50),
 ('XL', 40),
..."><code class="variable-group">(</code><code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">M</code><code class="variable-quote">'</code><code class="variable-op">, </code>1000<code class="variable-group">)</code><code class="variable-op">, </code><code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">CM</code><code class="variable-quote">'</code><code class="variable-op">, </code>900<code class="variable-group">)</code><code class="variable-op">, </code><code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">D</code><code class="variable-quote">'</code><code class="variable-op">, </code>500<code class="variable-group">)</code><code class="variable-op">, </code><code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">CD</code><code class="variable-quote">'</code><code class="variable-ellipsis">...</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="roman-module.html#toRomanTable" class="summary-name">toRomanTable</a> = <code title="[None,
 'I',
 'II',
 'III',
 'IV',
 'V',
 'VI',
 'VII',
..."><code class="variable-group">[</code>None<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">I</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">II</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">III</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">IV</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">V</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">VI</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">VII</code><code class="variable-quote">'</code><code class="variable-ellipsis">...</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="roman-module.html#fromRomanTable" class="summary-name">fromRomanTable</a> = <code title="{'C': 100,
 'CC': 200,
 'CCC': 300,
 'CCCI': 301,
 'CCCII': 302,
 'CCCIII': 303,
 'CCCIV': 304,
 'CCCIX': 309,
..."><code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">C</code><code class="variable-quote">'</code><code class="variable-op">: </code>100<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">CC</code><code class="variable-quote">'</code><code class="variable-op">: </code>200<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">CCC</code><code class="variable-quote">'</code><code class="variable-op">: </code>300<code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">CCCI</code><code class="variable-quote">'</code><code class="variable-op">: </code>301<code class="variable-ellipsis">...</code></code>
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES DETAILS ==================== -->
<a name="section-VariablesDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-VariablesDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="romanNumeralMap"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">romanNumeralMap</h3>
  
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<code class="variable-group">(</code><code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">M</code><code class="variable-quote">'</code><code class="variable-op">, </code>1000<code class="variable-group">)</code><code class="variable-op">,</code>
 <code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">CM</code><code class="variable-quote">'</code><code class="variable-op">, </code>900<code class="variable-group">)</code><code class="variable-op">,</code>
 <code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">D</code><code class="variable-quote">'</code><code class="variable-op">, </code>500<code class="variable-group">)</code><code class="variable-op">,</code>
 <code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">CD</code><code class="variable-quote">'</code><code class="variable-op">, </code>400<code class="variable-group">)</code><code class="variable-op">,</code>
 <code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">C</code><code class="variable-quote">'</code><code class="variable-op">, </code>100<code class="variable-group">)</code><code class="variable-op">,</code>
 <code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">XC</code><code class="variable-quote">'</code><code class="variable-op">, </code>90<code class="variable-group">)</code><code class="variable-op">,</code>
 <code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">L</code><code class="variable-quote">'</code><code class="variable-op">, </code>50<code class="variable-group">)</code><code class="variable-op">,</code>
 <code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">XL</code><code class="variable-quote">'</code><code class="variable-op">, </code>40<code class="variable-group">)</code><code class="variable-op">,</code>
<code class="variable-ellipsis">...</code>
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<a name="toRomanTable"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">toRomanTable</h3>
  
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<code class="variable-group">[</code>None<code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">I</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">II</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">III</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">IV</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">V</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">VI</code><code class="variable-quote">'</code><code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">VII</code><code class="variable-quote">'</code><code class="variable-op">,</code>
<code class="variable-ellipsis">...</code>
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<a name="fromRomanTable"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">fromRomanTable</h3>
  
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<code class="variable-group">{</code><code class="variable-quote">'</code><code class="variable-string">C</code><code class="variable-quote">'</code><code class="variable-op">: </code>100<code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">CC</code><code class="variable-quote">'</code><code class="variable-op">: </code>200<code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">CCC</code><code class="variable-quote">'</code><code class="variable-op">: </code>300<code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">CCCI</code><code class="variable-quote">'</code><code class="variable-op">: </code>301<code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">CCCII</code><code class="variable-quote">'</code><code class="variable-op">: </code>302<code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">CCCIII</code><code class="variable-quote">'</code><code class="variable-op">: </code>303<code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">CCCIV</code><code class="variable-quote">'</code><code class="variable-op">: </code>304<code class="variable-op">,</code>
 <code class="variable-quote">'</code><code class="variable-string">CCCIX</code><code class="variable-quote">'</code><code class="variable-op">: </code>309<code class="variable-op">,</code>
<code class="variable-ellipsis">...</code>
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://sites.google.com/site/pyminesweeper/">Minesweeper</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Jun 23 10:03:16 2008
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
